package com.example.playerinfogame

import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {

    private lateinit var tvName: TextView
    private lateinit var tvGender: TextView
    private lateinit var tvPhone: TextView
    private lateinit var tvScore: TextView
    private lateinit var btnEdit: Button
    private lateinit var btnGame: Button

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // 初始化控件
        tvName = findViewById(R.id.tvName)
        tvGender = findViewById(R.id.tvGender)
        tvPhone = findViewById(R.id.tvPhone)
        tvScore = findViewById(R.id.tvScore)
        btnEdit = findViewById(R.id.btnEdit)
        btnGame = findViewById(R.id.btnGame)

        // 设置默认数据
        tvName.text = "张三"
        tvGender.text = "男"
        tvPhone.text = "1234567890"
        tvScore.text = "0"

        // 点击“修改信息”跳转
        btnEdit.setOnClickListener {
            val intent = Intent(this, EditInfoActivity::class.java)
            startActivity(intent)
        }

        // 点击“翻牌游戏”跳转
        btnGame.setOnClickListener {
            val intent = Intent(this, FlipCardGameActivity::class.java)
            startActivity(intent)
        }
    }
}